【笔记】EditorConfig学习笔记

前言

EditorConfig is an open specification and file format for syntax highlighting, text editors and integrated development environment (IDEs) that aims to maintain a consistent coding style, particularly aimed at groups working together.(维基百科

创建配置文件

charset:指定文件编码集
indent_style:指定缩进方式

spacetab

indent_size:指定缩进大小
end_of_line:指定换行符

lfcrlfcr

trim_trailing_whitespace:指定是否删除行尾空白字符
insert_final_newline:指定是否添加文件末尾空行

.editorconfig
1
2
3
4
5
6
7
8
9
10
11
12
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.go]
indent_style = tab

完成